<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>检查记录</title>
    <link rel="stylesheet" href="css/vant.min.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/recordDetails.css?v=0.9">
</head>

<body>
    <div id="app" v-cloak>
        <div class="flex-col page">
            <div class="flex-col flex-auto section">
                <div class="flex-col relative section_2 space-y-16">
                    <div class="ub-title">
                        <p>{{top.place_name}}</p>
                        <img src="images/place9xiao.png" alt="" v-if="top.is_small_place!=0">
                    </div>
                    <!-- <p>地址</p> -->
                    <div class="ub-add">
                        <img src="images/placeLocation.png" alt="">
                        <p>{{top.address}}</p>
                    </div>
                    <div class="flex-row justify-between items-baseline">
                        <span class="font_1">检查人</span>
                        <div class="group_2">
                            <span class="font_1 text_3" v-cloak>{{top.check_user}}：</span>
                            <a class="font_2" @click="callPhone(top.check_phone)" v-cloak>{{top.check_phone}}</a>
                        </div>
                    </div>
                    <div class="flex-row justify-between">
                        <span class="font_1">检查时间</span>
                        <span class="font_1 text_4" v-cloak>{{top.check_time}}</span>
                    </div>
                    <!-- <ul class="ub-tableUl">
                        <li><a href="#fire0">消防安全</a></li>
                        <li><a href="#fire1">燃气安全</a></li>
                        <li><a href="#fire2">房屋安全</a></li>
                        <li><a href="#fire3">用电安全</a></li>
                        <li><a href="#fire4">其他</a></li>
                    </ul> -->
                </div>
                <div class="flex-col group_3 space-y-60" style="padding-bottom: 80px;">
                    <div v-for="(item,index) in list" :key="index" style="position: relative;">
                        <p class="ub-titlex">{{item.name}}</p>
                        <!-- <div :id="'fire' + index"
                            style="position:absolute ;    top: 0px;    width: 10px;    height: 10px;    z-index: -1;">
                        </div> -->
                        <div class="flex-col space-y-20" style="margin-bottom: 8px;">
                            <div class="flex-col section_4" v-for="(e,i) in item.list" :key="i">
                                <div class=" flex-col justify-start items-start text-wrapper">
                                    <span class="font_3 text_5">标准{{i+1}}</span>
                                </div>
                                <div class="flex-col group_6 space-y-16">
                                    <div class="">
                                        <p class="font_1">标准要求：</p>
                                        <p class="font_1">{{e.project}}</p>
                                    </div>
                                    <div class="flex-row">
                                        <span class="font_1">是否符合标准：</span>
                                        <span class="font_5 text_7" v-cloak>{{e.is_standard}}</span>
                                    </div>
                                    <div class="flex-row " v-if="e.is_standard=='否'">
                                        <span class="font_1">整改时限:</span>
                                        <span class="font_5 text_7" style="font-weight: bold;"
                                            v-cloak>{{e.deadline}}</span>
                                    </div>
                                </div>
                                <div v-if="e.is_standard=='否'">
                                    <div class="flex-col group_7 space-y-7" v-if="e.content != ''" v-cloak>
                                        <span class="self-start font_5">情况说明</span>
                                        <div class="flex-col justify-start text-wrapper_3" v-cloak>
                                            <span class="text_9" v-cloak>{{e.content}}</span>
                                        </div>
                                    </div>
                                    <div class="flex-col group_7 space-y-8" style="margin-top: 8px;"
                                        v-if="e.images.length != 0">
                                        <span class="self-start font_5">照片</span>
                                        <div class="flex-row space-x-10" style="flex-wrap: wrap;">
                                            <img class="equal-division-item" :src="item" v-cloak
                                                v-for="(item,index) in e.images" :key="index"
                                                @click="imgBig(index,e.images)" />
                                        </div>
                                    </div>
                                </div>

                                <div style="padding: 10px;" v-for="(ren,renI) in e.checkRectifyList" :key="renI">
                                    <div style="font-size: 14px;font-weight: 900;">第（{{renI+1}}）次</div>
                                    <div class="flex-row">
                                        <span class="font_1">整改人：</span>
                                        <span class="font_5 text_7" v-cloak>{{ren.realname}}</span>
                                    </div>
                                    <div class="flex-row">
                                        <span class="font_1">联系电话：</span>
                                        <span class="font_5 text_7" v-cloak>{{ren.phone}}</span>
                                    </div>
                                    <div class="flex-row">
                                        <span class="font_1">是否整改完毕：</span>
                                        <span class="font_5 text_7" v-cloak>{{ren.is_ok==0?'否':'是'}}</span>
                                    </div>
                                    <div class="flex-row">
                                        <span class="font_1">整改时间：</span>
                                        <span class="font_5 text_7" v-cloak>{{ren._time_datetime}}</span>
                                    </div>
                                    <div class="flex-col  space-y-7" v-if="ren.content != ''" v-cloak>
                                        <span class="self-start font_5">情况说明</span>
                                        <div class="flex-col justify-start text-wrapper_3" v-cloak>
                                            <span class="text_9" v-cloak>{{ren.content}}</span>
                                        </div>
                                    </div>
                                    <div class="flex-col group_7 space-y-8" style="margin-top: 8px;"
                                        v-if="ren.image_list_url.length != 0">
                                        <span class="self-start font_5">照片</span>
                                        <div class="flex-row space-x-10" style="flex-wrap: wrap;">
                                            <img class="equal-division-item" :src="img" v-cloak
                                                v-for="(img,imgI) in ren.image_list_url" :key="index"
                                                @click="imgBig(imgI,ren.image_list_url)" />
                                        </div>
                                    </div>
                                </div>
                                <div class="ub-jc_button" v-if="e.need_check && type==2 && is_standard==2"
                                    @click="goInspectionDetailsTurn(e.last_check_rectify_id,e.project_id,e.check_info_id)">
                                    <span class="font_6">整改</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="flex-row space-x-30 ub-btnBox">
                        <div class="flex-col justify-start items-center text-wrapper_4" @click="goBack()">
                            <span class="font_6">返回</span>
                        </div>
                        <div class="flex-col justify-start items-center text-wrapper_5" @click="goInspectionDetails()">
                            <span class="font_6">{{type==1?'再次检查':'整改'}}</span>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 查看图片 -->
            <!-- <div class="ub-bigImg" v-if="imgShow" @click="imgShow = false">
                <img :src="url" alt="">
            </div> -->
        </div>
    </div>

    <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/vant.min.js"></script>
    <script src="js/jwt-decode.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/cHttp.js?v=1.0.0" type="text/javascript" charset="utf-8"></script>
    <script src="js/jweixin-1.6.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/biliFlv.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/wxPublic.js?v=16.0.0" type="text/javascript" charset="utf-8"></script>
    <script>
        var vue = new Vue({
            el: '#app',
            data() {
                return {
                    url: '',
                    uuid: '', // uuid
                    type: '', //用于判断再次整改时应该走哪种类型
                    id: '', // 记录id
                    list: [], // 标准详情
                    top: {}, // 顶部详情
                    toKen: '',
                    imgShow: false, // 
                    status: 0,
                    status: 0,
                    is_standard: '', //只要某一种标准
                }
            },
            created() {
                this.id = getRequest().id;
                this.status = getRequest().status;
                this.type = getRequest().type;
                this.is_standard = getRequest().is_standard == 1 ? 2 : '';
                this.getDetails()
            },
            mounted() {
                window.addEventListener("visibilitychange", () => {
                    if (document.hidden) {

                    } else {
                        this.getDetails()
                    }
                })
            },
            methods: {
                // 返回检查记录
                goBack() {
                    history.back();
                    // if (this.status == 1) {
                    //     history.back();
                    // } else {
                    //     location.href = "./inspectionDetails.html?id=" + this.uuid;
                    //     sessionStorage.setItem('numx', 1)
                    // }

                },
                // 点击再次检查进入检查页面，0检查，1检查记录
                goInspectionDetails() {
                    if (this.type == 2) {
                        if (this.is_standard != 2) {
                            vant.Toast('暂无需要整改的标准');
                            return
                        }
                        let flag = false
                        this.list.map(el => {
                            el.list.map(item => {
                                if (item.need_check) {
                                    flag = true
                                }
                            })
                        })
                        if (!flag) {
                            vant.Toast('暂无需要整改的标准');
                            return
                        }
                        location.href = "./inspectionDetails1.html?id=" + this.uuid + '&check_id=' + this.id +
                            '&type=' +
                            this.type;
                        sessionStorage.setItem('numx', 0)
                    } else {
                        location.href = "./inspectionDetails.html?id=" + this.uuid + '&check_id=' + this.id +
                            '&type=' +
                            this.type;
                        sessionStorage.setItem('numx', 0)
                    }

                },

                // 大图片
                imgBig(i, images) {
                    vant.ImagePreview({
                        images,
                        startPosition: i,
                    });
                },
                // 详情
                getDetails() {
                    ajax({
                        url: formal + '/place-check/check-info?id=' + this.id + "&is_standard=" + this
                            .is_standard,
                        type: 'GET',
                        success: (res) => {
                            this.top = res
                            this.list = res.details
                            this.uuid = res.place_id
                        }
                    })
                },
                //点击手机号进行拨打
                callPhone(phone) {
                    console.log(phone);
                },
                // 去单独检查页面
                goInspectionDetailsTurn(last_check_rectify_id, project_id, check_info_id) {
                    location.href = "./lookBack.html?project_id=" + project_id + '&check_info_id=' +
                        check_info_id + '&last_check_rectify_id=' +
                        last_check_rectify_id + '&place_id=' +
                        this.uuid + '&check_id=' +
                        this.id
                }
            }
        })
    </script>
</body>

</html>